package com.wlyuan.index.api.vo;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author yuanjie
 */
@Data
@EqualsAndHashCode
public class WaybillIndexVO implements Serializable {

    @Data
    public static class Address implements Serializable {
        private String province;
        private String city;
        private String district;
        private String provinceCode;
        private String cityCode;
        private String districtCode;
        private String address;
        private String contactName;
        private String contactMobile;
    }

    @Data
    public static class Combine implements Serializable {
        private Long combineId;
        private String combineNo;
        private String contractNo;
    }


    /**
     * @author yuanjie
     */
    @Data
    @EqualsAndHashCode
    public static class Relation implements Serializable {
        @ApiModelProperty("身份")
        private Integer character;
        @ApiModelProperty("运单状态")
        private Integer status;
        @ApiModelProperty("租户ID")
        private Long tenantId;
        // 报价单信息
        @ApiModelProperty("报价单ID")
        private Long quotationId;
        @ApiModelProperty("报价单号")
        private String quotationNo;
        @ApiModelProperty("报价状态")
        private Integer quotationStatus;
        // 对账单信息
        @ApiModelProperty("账单ID")
        private Long billId;
        @ApiModelProperty("账单号")
        private String billNo;
        @ApiModelProperty("账单名称")
        private String billName;
        @ApiModelProperty("账单状态")
        private Integer billStatus;
        @ApiModelProperty("账单时间")
        @JSONField(format = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
        private LocalDateTime billAt;
        // 签收信息
        @ApiModelProperty("签收类型")
        private Integer signType;
        @ApiModelProperty("签收时间")
        @JSONField(format = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
        private LocalDateTime signAt;

        @ApiModelProperty("标记")
        private List<Integer> highlights;

        @ApiModelProperty("可对账")
        private Boolean callBill;
        @ApiModelProperty("可报价")
        private Boolean callQuote;
    }

    @ApiModelProperty("运单ID")
    private Long waybillId;
    @ApiModelProperty("订单ID")
    private Long orderId;
    @ApiModelProperty("合同号")
    private String contractNo;
    @ApiModelProperty("发货地址")
    private Address fromAddress;
    @ApiModelProperty("收货地址")
    private Address toAddress;
    @ApiModelProperty("发货时间")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    private LocalDateTime fromTime;
    @ApiModelProperty("收货时间")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    private LocalDateTime toTime;
    @ApiModelProperty("客户ID")
    private Long customerId;
    @ApiModelProperty("客户名称")
    private String customerName;
    @ApiModelProperty("客户类型")
    private Integer customerType;
    @ApiModelProperty("承运方ID")
    private Long carrierId;
    @ApiModelProperty("承运方名称")
    private String carrierName;
    @ApiModelProperty("承运方类型")
    private Integer carrierType;
    @ApiModelProperty("司机名称")
    private String driverName;
    @ApiModelProperty("司机ID")
    private Long driverId;
    @ApiModelProperty("收货方名称")
    private String consigneeName;
    @ApiModelProperty("收货方ID")
    private Long consigneeId;
    @ApiModelProperty("跟踪方式")
    private Integer trackType;
    @ApiModelProperty("跟踪单号")
    private String trackNo;
    @ApiModelProperty("提")
    private Boolean pick;
    @ApiModelProperty("送")
    private Boolean deliver;
    @ApiModelProperty("装")
    private Boolean load;
    @ApiModelProperty("卸")
    private Boolean unload;
    @ApiModelProperty("保价")
    private Boolean insure;
    @ApiModelProperty("运输模式")
    private Integer transportMode;
    @ApiModelProperty("运输距离")
    private Integer distanceType;
    @ApiModelProperty("总数量")
    private Integer totalQuantity;
    @ApiModelProperty("总重量")
    private BigDecimal calculateWeight;
    @ApiModelProperty("总体积")
    private BigDecimal calculateVolume;
    @ApiModelProperty("预付费")
    private BigDecimal prepayFee;
    @ApiModelProperty("到付费")
    private BigDecimal arrivePayFee;
    @ApiModelProperty("代收费")
    private BigDecimal collectionFee;
    @ApiModelProperty("回执费")
    private BigDecimal receiptFee;
    @ApiModelProperty("总费用")
    private BigDecimal totalFee;
    @ApiModelProperty("创建时间")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    private LocalDateTime createAt;
    @ApiModelProperty("是否被合并")
    private Boolean combined;
    @ApiModelProperty("合单信息")
    private Combine combine;
    @ApiModelProperty("关单状态")
    private Integer closeStatus;
    @ApiModelProperty("是否有费用")
    private Boolean hasFees;
    @ApiModelProperty("是否过关账期")
    private Boolean endBill;
    @ApiModelProperty("0:预计提前到达，1:预计超时，2:已超时")
    private Integer arrivalPlan;
    @ApiModelProperty("签收延期")
    private Boolean signDelayed;
    @ApiModelProperty("预约状态")
    private Integer bookingStatus;
    @ApiModelProperty("预约进场时间")
    private LocalDateTime bookingArrivalTime;
    @ApiModelProperty("是否原始运单")
    private Boolean original;
    @ApiModelProperty("是否从单")
    private Boolean affiliated;
    @ApiModelProperty("所属关系")
    private List<Relation> relations;
}
